package com.donald.publish

import com.google.gson.Gson
import org.junit.Test
import java.io.File

class MainTest {
    @Test
    fun parseVersionInfoTest() {
        val folder = File("D:\\Donald\\Qigsaw2Test\\app\\build\\outputs\\bundle\\debug\\splits")
        val gson = Gson()
        if (folder.exists()) folder.listFiles()?.forEach {
            val info = it.parseVersionInfo()
            println(gson.toJson(info))
        }
    }

    @Test
    fun publish() {
        val folder = File("D:\\Donald\\Qigsaw2Test\\app\\build\\outputs\\bundle\\debug\\splits")
        if (folder.exists()) {
            Main.main(arrayOf("-dir", folder.absolutePath))
        }
    }
}